<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="/static/css/layui.css">
    <title>Title</title>
</head>
<body>
<form class="layui-form layui-form-pane1" action="" lay-filter="first">
    <div class="layui-form-item">
        <label class="layui-form-label">姓名</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required|title" lay-reqText="标题不能为空" required placeholder="请输入标题" autocomplete="off" class="layui-input" >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机</label>
        <div class="layui-input-block">
            <input type="tel" name="tel" lay-verify="required|number" lay-verType="tips" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机1</label>
        <div class="layui-input-block">
            <input type="tel" name="tel1" lay-verify="required|number" lay-verType="tips" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input class="layui-btn" lay-submit lay-filter="*" value="立即提交">
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
<script src="/static/layui.js"></script>
<!-- <script src="../build/lay/dest/layui.all.js"></script> -->

<script>

    layui.use(['form', 'layedit', 'laydate'], function(){
        var $ = layui.$;
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;


        //监听提交
        var url = 'index/test';
        form.on('submit(*)', function(data){
            $.ajax({
                url: url,
                type:"POST",
                dataType:"json",
                data:data.field,
                success:function(data){
                    console.log(data)
                }
            });
            return false;
        });
        return false;
    });

</script>
</html>